/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "ads", catalog = "OnlineShopFourDVD", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Ads.findAll", query = "SELECT a FROM Ads a"),
    @NamedQuery(name = "Ads.findByAdvId", query = "SELECT a FROM Ads a WHERE a.advId = :advId"),
    @NamedQuery(name = "Ads.findByTitle", query = "SELECT a FROM Ads a WHERE a.title = :title"),
    @NamedQuery(name = "Ads.findByPosition", query = "SELECT a FROM Ads a WHERE a.position = :position"),
    @NamedQuery(name = "Ads.findByPriority", query = "SELECT a FROM Ads a WHERE a.priority = :priority"),
    @NamedQuery(name = "Ads.findByAdvType", query = "SELECT a FROM Ads a WHERE a.advType = :advType"),
    @NamedQuery(name = "Ads.findByAdvFile", query = "SELECT a FROM Ads a WHERE a.advFile = :advFile"),
    @NamedQuery(name = "Ads.findByIsScriptCode", query = "SELECT a FROM Ads a WHERE a.isScriptCode = :isScriptCode"),
    @NamedQuery(name = "Ads.findByWidth", query = "SELECT a FROM Ads a WHERE a.width = :width"),
    @NamedQuery(name = "Ads.findByHeight", query = "SELECT a FROM Ads a WHERE a.height = :height"),
    @NamedQuery(name = "Ads.findByAdvAlt", query = "SELECT a FROM Ads a WHERE a.advAlt = :advAlt"),
    @NamedQuery(name = "Ads.findByUrlClick", query = "SELECT a FROM Ads a WHERE a.urlClick = :urlClick"),
    @NamedQuery(name = "Ads.findByCreateDate", query = "SELECT a FROM Ads a WHERE a.createDate = :createDate"),
    @NamedQuery(name = "Ads.findByStartdate", query = "SELECT a FROM Ads a WHERE a.startdate = :startdate"),
    @NamedQuery(name = "Ads.findByEnddate", query = "SELECT a FROM Ads a WHERE a.enddate = :enddate"),
    @NamedQuery(name = "Ads.findByScriptCode", query = "SELECT a FROM Ads a WHERE a.scriptCode = :scriptCode"),
    @NamedQuery(name = "Ads.findByStatus", query = "SELECT a FROM Ads a WHERE a.status = :status")})
public class Ads implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "adv_id", nullable = false)
    private Integer advId;
    @Column(name = "title", length = 50)
    private String title;
    @Column(name = "position", length = 50)
    private String position;
    @Column(name = "priority")
    private Integer priority;
    @Column(name = "adv_type")
    private Integer advType;
    @Column(name = "adv_file", length = 50)
    private String advFile;
    @Column(name = "is_script_code")
    private Character isScriptCode;
    @Column(name = "width")
    private Integer width;
    @Column(name = "height")
    private Integer height;
    @Column(name = "adv_alt", length = 50)
    private String advAlt;
    @Column(name = "url_click", length = 100)
    private String urlClick;
    @Column(name = "create_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Column(name = "startdate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startdate;
    @Column(name = "enddate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date enddate;
    @Column(name = "script_code", length = 500)
    private String scriptCode;
    @Column(name = "status")
    private Character status;
    @JoinColumn(name = "category_id", referencedColumnName = "category_id", nullable = false)
    @ManyToOne(optional = false)
    private Category category;

    public Ads() {
    }

    public Ads(Integer advId) {
        this.advId = advId;
    }

    public Integer getAdvId() {
        return advId;
    }

    public void setAdvId(Integer advId) {
        this.advId = advId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public Integer getAdvType() {
        return advType;
    }

    public void setAdvType(Integer advType) {
        this.advType = advType;
    }

    public String getAdvFile() {
        return advFile;
    }

    public void setAdvFile(String advFile) {
        this.advFile = advFile;
    }

    public Character getIsScriptCode() {
        return isScriptCode;
    }

    public void setIsScriptCode(Character isScriptCode) {
        this.isScriptCode = isScriptCode;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public String getAdvAlt() {
        return advAlt;
    }

    public void setAdvAlt(String advAlt) {
        this.advAlt = advAlt;
    }

    public String getUrlClick() {
        return urlClick;
    }

    public void setUrlClick(String urlClick) {
        this.urlClick = urlClick;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getStartdate() {
        return startdate;
    }

    public void setStartdate(Date startdate) {
        this.startdate = startdate;
    }

    public Date getEnddate() {
        return enddate;
    }

    public void setEnddate(Date enddate) {
        this.enddate = enddate;
    }

    public String getScriptCode() {
        return scriptCode;
    }

    public void setScriptCode(String scriptCode) {
        this.scriptCode = scriptCode;
    }

    public Character getStatus() {
        return status;
    }

    public void setStatus(Character status) {
        this.status = status;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (advId != null ? advId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ads)) {
            return false;
        }
        Ads other = (Ads) object;
        if ((this.advId == null && other.advId != null) || (this.advId != null && !this.advId.equals(other.advId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.Ads[advId=" + advId + "]";
    }

}
